package cn.chenxiejia;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/***
 * @program: maven
 * @ClassName: Logo
 * @Description:
 * @Author: chenxiejia
 * @Date: 2022/1/24 15:04
 * @version : V1.0
 */
public class Logo {
    public static void main(String[] args) {
        try {
            //读取背景图片
            BufferedImage bi = ImageIO.read(Thread.currentThread().getContextClassLoader().getResourceAsStream("img/1.jpg"));
            int h = bi.getHeight();
            int w = bi.getWidth();
            //读取logo图片
            BufferedImage src = ImageIO.read(new File("yanzheng.jpg"));
            int srch = src.getHeight();
            int srcw = src.getWidth();

            var m = bi.createGraphics();

            m.drawImage(src, 10, 10, null);
            m.dispose();
            ImageIO.write(bi, "jpg", new File("logo.jpg"));
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
